<template>
	<view class="page">
		<view v-if="id == 0">
			<u-parse :html="body.service_desc"></u-parse>
		</view>
		<view v-else>
			<u-parse :html="body.privacy_desc"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				body: '',
				id: ''
			}
		},
		onLoad(option) {
			this.id = option.id
			uni.showLoading({
				title: '加载中'
			})
			this.getData()
		},
		onShow() {
			if (this.id == 0) {
				uni.setNavigationBarTitle({
						title: '平台服务协议'
				})
			} else {
				uni.setNavigationBarTitle({
						title: '隐私政策'
				})
			}
		},
		methods: {
				//关于我们
				getData() {
					this.$api.post(global.apiUrls.getAbout, {}).then(res => {
						uni.hideLoading()
						if (res.data.code == 1) {
							console.log(res)
							this.body = res.data.data
						} else {
							this.$message.info(res.data.msg)
						}
					})
				}
			}
		}
</script>

<style lang="scss" scoped>
	.page {
		min-height: 100vh;
		background: #FFFFFF;
		padding: 32rpx;
		font-size: 28rpx;
		color: #333333;
		line-height: 38rpx;
	}
</style>
